﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/AdminMasterPage.Master" CodeBehind="MasterManagement.aspx.vb" Inherits="LinhKienMayTinh.MasterManagement" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">        
        var btnDeleteId = "<%=btnDelete.ClientID%>";
        var btnSaveId = "<%=btnSave.ClientID%>"
        var hdnCodeId = "<%=hdnCode.ClientID%>";
        var hdnNameId = "<%=hdnName.ClientID%>";
        var txtNewId = "<%=txtNew.ClientID%>";
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPage" runat="server">
    <div id="content">
        <div id="master">
            <asp:RadioButton ID="radCategory" runat="server" AutoPostBack="true" GroupName="GroupMaster" Text="Category" Checked="true" />
            <asp:RadioButton ID="RadManufactory" runat="server" AutoPostBack="true" GroupName="GroupMaster" Text="Manufactory" />
        </div>
        <div id="add-new">
            <span>Thêm mới </span><asp:TextBox ID="txtNew" runat="server"></asp:TextBox>
            <asp:Button ID="btnAddNew" runat="server" Text="Thêm" OnClientClick="return MasterManagement.AddNew();" />
        </div>
        <div>
            <asp:Button ID="btnDelete" runat="server" CssClass="invisible" />
            <asp:Button ID="btnSave" runat="server" CssClass="invisible" />
            <asp:HiddenField ID="hdnCode" runat="server" />
            <asp:HiddenField ID="hdnName" runat="server" />            
            <table id="list-items" cellpadding="0" cellspacing="0" border="1">
                <tr>
                    <th>ID</th>
                    <th>Name</th>
                    <th>Function</th>
                </tr>
                <%If dsSource IsNot Nothing Then
                        For Each item In dsSource.Tables(0).Rows                            
                %>
                    <tr>
                    <td class="col-id"><%=item("CODE")%></td>
                    <td class="col-name">
                        <span class="lb-name"><%=item("NAME")%></span>
                        <span class="edit-name">
                            <input class="edit-textbox" type="text" maxlength="255" />
                            <input class="master-code" type="hidden" value="<%=item("CODE")%>" />
                            <a href="#" onclick="return false;" class="button-save">Save</a>
                            <a href="#" onclick="return false;" class="button-cancel">Cancel</a>
                        </span>
                    </td>
                    <td class="col-function">
                        <a href="#" onclick="MasterManagement.DeleteMaster(<%=item("CODE")%>)">Delete</a>
                        <a href="#" onclick="MasterManagement.EditMaster()" class="button-edit">Edit</a>                                                            
                    </td>
                </tr>
                <%
                Next
            End If%>
            </table>

        </div>
    </div>
</asp:Content>
